package com.oa.co.controller;
/*
 *                                                     __----~~~~~~~~~~~------___
 *                                    .  .   ~~//====......          __--~ ~~
 *                    -.            \_|//     |||\\  ~~~~~~::::... /~
 *                 ___-==_       _-~o~  \/    |||  \\            _/~~-
 *         __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
 *     _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
 *   .~       .~       |   \\ -_    /  /-   /   ||      \   /
 *  /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
 *  |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
 *           '         ~-|      /|    |-~\~~       __--~~
 *                       |-~~-_/ |    |   ~\_   _-~            /\
 *                            /  \     \__   \/~                \__
 *                        _--~ _/ | .-~~____--~-/                  ~~==.
 *                       ((->/~   '.|||' -_|    ~~-/ ,              . _||
 *                                  -_     ~\      ~~---l__i__i__i--~~_/
 *                                  _-~-__   ~)  \--______________--~~
 *                                //.-~~~-~_--~- |-------~~~~~~~~
 *                                       //.-~~~--\
 *                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 *                               神兽保佑            永无BUG
 */

import com.oa.co.common.R;
import com.oa.co.pojo.Expense_account;
import com.oa.co.pojo.Overtime_application_form;
import com.oa.co.service.ExpenseAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sunXuDong
 * @data 2023/5/8
 */
@RestController
@CrossOrigin("*")
@RequestMapping("/api/expenseAccountController")
public class ExpenseAccountController {
    @Autowired
    private ExpenseAccountService expenseAccountService;
    //回显数据
    @RequestMapping("/partialData")
    public R partialData(Expense_account expense_account){
        expense_account.setD_id("BX-"+System.currentTimeMillis());
        return R.ok().data("res",expense_account);
    }
    //全部数据提交添加
    @RequestMapping("/allDate")
    public R allDate(@RequestBody Expense_account expense_account){

        return expenseAccountService.allDate(expense_account);
    }
    //撤回功能
    @RequestMapping("/deleteDate")
    public R deleteDate(@RequestBody  Expense_account expense_account){

        return expenseAccountService.deleteDate(expense_account);
    }
    //根据订单查询详细信息
    @RequestMapping("/query")
    public R query(String d_id){

        return expenseAccountService.query(d_id);
    }

}
